<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<div class="box m">
	<div class="btitle path">
		<a title="<spring:message code="top.header.homepage" />" href="goHomePage.html"><spring:message code="top.header.homepage" /></a>&nbsp;»&nbsp; <a
			href="goNews.html"><spring:message code="top.header.news" /></a>
	</div>
	<div class="bCt nsList">
		<c:forEach items="${newsList}" var="n">
			<div class="it">
				<a href="viewNews.html?id=${n.id}" title="<c:out value='${n.name }'/>"> <img
					src="<c:url value="loadImage.html?type=THUMB&fileId=${n.articleImages[0]}"/>" alt="<c:out value='${n.name }'/>" class="float"
					style="width: 130px; height: 100px; border: 1px solid #ccc;">
				</a> <a href="viewNews.html?id=${n.id}" title="<c:out value='${n.name }'/>">
					<h3 class="title">
						<c:out value='${n.name }' />
					</h3>
				</a> <span class="date"> <fmt:setLocale value="${pageContext.request.locale}" /> <fmt:formatDate value="${createdDate}" />
				</span>
				<div class="desc">
					${n.shortDescription }
				</div>
				<div class="details">
					<a href="viewNews.html?id=${n.id}" title=""><spring:message code="news.go.details" /></a>
				</div>
				<div style="clear: both"></div>
			</div>
		</c:forEach>
		<div class="clear"></div>
		<c:if test="${not empty newsList }">
			<c:if test="${newsList[0].totalPage > 1}">
				<div style="text-align: center;" class="pages">
					<div style="display: inline-block;">
						<spring:message code="page.pagination.title" />
						<c:forEach begin="1" end="${newsList[0].totalPage}" step="1" var="page">
							<c:if test="${page == param.page }">
								<span class="current">${page}</span>&nbsp;|
							</c:if>

							<c:if test="${!(page == param.page)}">
								<span><a href="searchNews.html?page=${page}">${page}</a></span>&nbsp;|
							</c:if>
						</c:forEach>
					</div>
				</div>
			</c:if>
		</c:if>
	</div>
</div>

